import os
import sys

def find_png_jpg_files(directory):
    png_jpg_files = []
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.lower().endswith(('.png', '.jpg')):
                png_jpg_files.append(os.path.join(root, file))
    return png_jpg_files

def main():
    if len(sys.argv) != 2:
        print("Usage: python script_name.py <directory>")
        return
    
    directory = sys.argv[1]
    if not os.path.isdir(directory):
        print("错误：指定路径不存在或不是一个目录！")
        return
    
    png_jpg_files = find_png_jpg_files(directory)
    
    if not png_jpg_files:
        print("在指定路径下没有找到任何PNG或者JPG文件。")
    else:
        print("在指定路径下找到的PNG或者JPG文件如下：")
        for file in png_jpg_files:
            print(file)

if __name__ == "__main__":
    main()
